<template>
	<div :id="id" class="badgeWhite baseContent" :style="dataRend.style" v-loading="active">
		<basetitle>
			<slot slot="left">{{dataRend.name}}</slot>
			<slot slot="right">
				<div class="rightFontCont"><i class="iconfont icon-shuaxin1 rightFont" @click="refreshFull(dataRend.prn)"></i></div>
			</slot>
		</basetitle>
		<div class="baseCont">
		<div class="chart-container overAuto" v-if="dataRend.itemData"  :style="{ height: dataRend.itemData.height != '' ? dataRend.itemData.height : defalutHeight }">
			<div class="magtop10"><ListplateSix :itemdata="dataRend.itemData" /></div>
		</div>
		</div>
	</div>
</template>
<script>
import { generateMixed } from '@/utils/index.js';
import { getFromCache } from '@/utils/cache.js';
const basetitle =()=>import('@/components/basetitle/index.vue')//
const ListplateSix =()=>import('@/components/Listplate/ListplateSix.vue')//
import {getHomePage,refreshContent} from "../../../api/config.js"
import store from '../../../store'
import { mapState, mapActions } from 'vuex'
export default {
	name: 'JiuList',
	mixins: [],
	props: {
		className: {
			type: String,
			default: 'baseId' + generateMixed('8')
		},
		id: {
			type: String,
			default: 'baseId' + generateMixed('8')
		},
		defalutHeight: {
			type: String,
			default: '300px'
		},
		itemdata: {
			default: Object
		},
		itemStyle: {
			default: Object
		}
	},
	components: {
		basetitle,
		ListplateSix
	},
	data() {
		return {
			tabPosition:'top',
			dataRend:{},
			active:false
		};
	},
	computed: {
		...mapState({
			   mainRend:state => store.state.base.mainRend
		}),
	},
	beforeDestroy() {

	},
	mounted() {
		 this.dataRend=this.itemdata
	},
	methods: {
		...mapActions('base', ['getIndexRend']),
		refreshFull(type){
			let that=this;
			that.active=true;
			let parms={};
			parms.type=type;
      parms.user_prn = JSON.parse(getFromCache('userInfo')).env$user_prn;
			that.$post(refreshContent, parms).then(response => {
				setTimeout(function () {
				that.active=false;
				},2000);
				that.dataRend=response.obj
			})
		}
	},
	watch:{

	}
};
</script>

<style></style>
